﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Pages/Site1.Master" AutoEventWireup="true" CodeBehind="Student.aspx.cs" Inherits="ES_Project.Pages.WebForm10" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style2
        {
            width: 100%;
        }
        .style3
        {
            width: 59px;
        }
        .style4
        {
            width: 1167px;
        }
    </style>
   
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
   
 

<link type="text/css" href="js/js/css/ui-lightness/jquery-ui-1.8.10.custom.css" rel="stylesheet" />	
<link type="text/css" href="js/js/css/jquery.timeentry.css" rel="stylesheet" />
  <script type="text/javascript" src="js/js/jquery-1.4.4.min.js"></script>
  <script type="text/javascript" src="js/js/jquery-ui-1.8.10.offset.datepicker.min.js"></script>
  <script type="text/javascript" src="js/js/jquery.datepick-th.js"></script>
  <script type="text/javascript" src="js/js/jquery-ui-timepicker-addon.js"></script>
  <script type="text/javascript" src="js/js/jquery.timeentry.js"></script>
  <script type="text/javascript" src="js/js/jquery.timeentry.min.js"></script>
  <script type="text/javascript" src="js/js/jquery.timeentry.pack.js"></script>

<SCRIPT type=text/javascript>
    function getFormattedDate(date) {
        var day = date.getDate();
        var month = date.getMonth() + 1;
        var year = date.getFullYear().toString().slice(2);
        return day + '-' + month + '-' + year;
    }
    function GotoInput2(pagGo) {

        emailwindow = dhtmlmodal.open('EmailBox', 'iframe', pagGo, ' ', 'width=923px,height=545px,center=1,resize=0,scrolling=1')

        emailwindow.onclose = function () {


            return true

        }


    }

    function GotoInput(pagGo) {

        emailwindow = dhtmlmodal.open('EmailBox3', 'iframe', pagGo, ' ', 'width=840px,height=405px,center=1,resize=0,scrolling=1')

        emailwindow.onclose = function () {

            return true

        }
    }

    //-->

				</SCRIPT>
  <style type="text/css">


/* Overide css code กำหนดความกว้างของปฏิทินและอื่นๆ */ 
.ui-datepicker{

	width:190px;

	font-family:tahoma;

	font-size:11px;

	text-align:center;

}
      .style3
      {
          height: 22px;
      }
      .style7
      {
          text-align: left;
      }
      .style13
      {
          font-size: small;
          text-align: left;
          width: 200px;
      }
      .style15
      {
          text-align: left;
          width: 218px;
      }
      .style16
      {
          font-size: small;
          text-align: right;
          width: 218px;
      }
      .style17
      {
          font-size: small;
          width: 218px;
      }
      .style18
      {
          width: 218px;
      }
      .style27
      {
          font-size: medium;
          text-align: left;
          width: 363px;
      }
      .style28
      {
          font-size: small;
          text-align: right;
          width: 153px;
      }
      .style29
      {
          font-size: small;
          width: 153px;
      }
      .style30
      {
          text-align: left;
          width: 153px;
      }
      .style31
      {
          font-size: small;
          text-align: right;
          width: 200px;
      }
      .style35
      {
          font-size: small;
          width: 200px;
      }
      .style37
      {
          width: 216px;
      }
      .style38
      {
          font-size: small;
          width: 216px;
      }
      .FileManagerTreeNodeSelected
      {}
    .style39
    {
        width: 100px;
    }
    .style40
    {
        width: 100px;
        font-size: small;
        text-align: right;
    }
    .style42
    {
        font-size: small;
        width: 74px;
        text-align: right;
    }
    .style44
    {
        font-size: small;
        text-align: right;
    }
    .style45
    {
        width: 72px;
    }
      .style46
      {
          width: 379px;
      }
      .style49
      {
          font-size: small;
          text-align: right;
          width: 92px;
      }
      .style51
      {
          color: #FF3300;
      }
      .style55
      {
          width: 170px;
      }
      .style59
      {
          font-size: small;
          width: 71px;
          text-align: right;
      }
      .style62
      {
          font-size: small;
          text-align: right;
          width: 179px;
      }
      .style63
      {
          width: 226px;
      }
      .style64
      {
          width: 179px;
      }
        .style58
        {
            color: #FF3300;
            font-size: small;
        }
      .style65
      {
          text-align: right;
      }
      .style67
      {
          font-size: medium;
      }
      .style68
      {
          width: 216px;
          text-align: right;
      }
      </style>
 <script type="text/javascript">
     $(function BindEvents() {
         var dateBefore = null;

         $("#ContentPlaceHolder1_TextBox8").datepicker({


             showOn: 'button',
             isBuddhist: true,
             buttonImage: 'images/formcal.gif',
             buttonImageOnly: true
         });

     });</script>

   
    <script type="text/javascript">
        $(function BindEvents2() {
            var dateBefore = null;

            $("#ContentPlaceHolder1_TextBox21").datepicker({


                showOn: 'button',
                isBuddhist: true,
                buttonImage: 'images/formcal.gif',
                buttonImageOnly: true
            });

        });</script>
         <script type="text/javascript">
             $(function BindEvents3() {
                 var dateBefore = null;

                 $("#ContentPlaceHolder1_TextBox12").datepicker({


                     showOn: 'button',
                     isBuddhist: true,
                     buttonImage: 'images/formcal.gif',
                     buttonImageOnly: true
                 });

             });</script>
              <script type="text/javascript">
                  $(function BindEvents4() {
                      var dateBefore = null;

                      $("#ContentPlaceHolder1_TextBox47").datepicker({


                          showOn: 'button',
                          isBuddhist: true,
                          buttonImage: 'images/formcal.gif',
                          buttonImageOnly: true
                      });

                  });</script>
             <script language="javascript" type="text/javascript">
                 function calAge(o) {
                     var tmp = o.value.split("/");
                     var current = new Date();
                     var current_year = current.getFullYear();

                     document.getElementById("ContentPlaceHolder1_TextBox10").value = current_year - (tmp[2] - 543);
                 }

                 function confirm_save() {
                     if (confirm("ต้องการบันทึกข้อมูลใช่หรือไม่") == true)
                         return true;
                     else
                         return false;
                 }

 
</script>
 <script type="text/javascript">
     function chButton() {
       
         if (document.getElementById("ContentPlaceHolder1_TextBox2").value == "") {
             alert("กรุณาระบุรหัสนักเรียน");

             return (false);
         }
         if (document.getElementById("ContentPlaceHolder1_TextBox3").value == "") {
             alert("กรุณาระบุชื่อนักเรียน");

             return (false);
         }
         if (document.getElementById("ContentPlaceHolder1_TextBox21").value == "") {
                alert("กรุณาระบุวันที่สมัครเรียน !");
                return (false);
            }
            if (document.getElementById("ContentPlaceHolder1_Label39").value == "") {
                alert("กรุณาระบุส่วนลด !");
                return (false);
            }
            
         
         return true;

     }



     function CheckOnOff(rdoId,gridName)
{
var rdo = document.getElementById(rdoId);

/* Getting an array of all the “INPUT” controls on the form.*/
var all = document.getElementsByTagName("input");
for(i=0;i<all.length;i++)
{ 
/*Checking if it is a radio button, and also checking if the
id of that radio button is different than “rdoId” */
if(all[i].type=="radio" && all[i].id != rdo.id)
{
var count=all[i].id.indexOf(gridName);
if(count!=-1)
{
all[i].checked=false;
}
}
}
rdo.checked=true;/* Finally making the clicked radio button CHECKED */
}


 </script>
 <script type="text/javascript">
     function selectbu() {
       
         if (document.getElementById("ContentPlaceHolder1_TextBox46").value == "") {
             alert("กรุณาเลือกวิชา");

             return (false);
         }
        
            
         
         return true;

     }
      </script>
    <p>

        <asp:ScriptManager ID="ScriptManager1" runat="server" />
    </p>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <table cellpadding="0" cellspacing="0" class="style2">
                <tr>
                    <td class="style3">
                        &nbsp;</td>
                    <td class="style4">
                        <strong><span class="style67">บันทึกข้อมูลนักเรียน&nbsp;&nbsp;&nbsp;&nbsp;</span>&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:TextBox ID="TextBox34" runat="server" Width="82px"  style="display:none" ></asp:TextBox>
                        <asp:TextBox ID="TextBox35" runat="server" Width="73px"   style="display:none"></asp:TextBox>
                        </strong></td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style3">
                        &nbsp;</td>
                    <td class="style4">
                                    <asp:TextBox ID="familycode" runat="server"   style="display:none"></asp:TextBox>
                                    <asp:TextBox ID="afterfamilycode" runat="server"  style="display:none"></asp:TextBox>
                    </td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style3">
                        &nbsp;</td>
                    <td class="style4">
                        <table cellpadding="0" cellspacing="0" class="style2">
                            <tr>
                                <td class="style16">
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                                <td class="style31">
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                                <td class="style28">
                                    &nbsp;</td>
                                <td>
                                    <asp:Button ID="Button10" runat="server" onclick="Button10_Click" 
                                        Text="พิมพ์ใบเสร็จ" />
                                </td>
                            </tr>
                            <tr>
                                <td class="style16">
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                                <td class="style31">
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                                <td class="style28">
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td class="style16">
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                                <td class="style31">
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                                <td class="style28">
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td class="style16">
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                                <td class="style31">
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                                <td class="style28">
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td class="style16">
                                    <strong>รหัสนักเรียน :</strong></td>
                                <td>
                                    <asp:TextBox ID="TextBox2" runat="server" CssClass="style7" Width="120px"></asp:TextBox>
                                    <span class="style51">*</span></td>
                                <td class="style31">
                                    <strong>ชื่อ-นามสกุล นักเรียน :</strong></td>
                                <td>
                                    <asp:TextBox ID="TextBox3" runat="server" CssClass="style7" Width="120px"></asp:TextBox>
                                    <span class="style51">*</span></td>
                                <td class="style28">
                                    <strong>ชื่อเล่น :</strong></td>
                                <td>
                                    <asp:TextBox ID="TextBox4" runat="server" CssClass="style7" Width="120px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="style17">
                                    &nbsp;</td>
                                <td class="style7">
                                    <asp:TextBox ID="st_id" runat="server" style="display:none" ></asp:TextBox>
                                </td>
                                <td class="style13">
                                    &nbsp;</td>
                                <td class="style7">
                                    &nbsp;</td>
                                <td class="style29">
                                    &nbsp;</td>
                                <td class="style7">
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td class="style16">
                                                <strong style="text-align: right">ที่อยู่ :</strong></td>
                                <td>
                                                <span class="style58">
                                                <textarea ID="TextArea2" runat="server"  cols="20" name="S2" rows="2"></textarea></span></td>
                                <td class="style31">
                                    <strong>เพศ :</strong></td>
                                <td>
                                    <asp:RadioButtonList ID="RadioButtonList1" runat="server" 
                                        RepeatDirection="Horizontal" style="font-size: small">
                                        <asp:ListItem Value="ชาย">ชาย</asp:ListItem>
                                        <asp:ListItem Value="หญิง">หญิง</asp:ListItem>
                                    </asp:RadioButtonList>
                                </td>
                                <td class="style28">
                                    <strong>เบอร์โทร :</strong></td>
                                <td>
                                    <asp:TextBox ID="TextBox11" runat="server" Width="120px" CssClass="style7"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="style17">
                                    &nbsp;</td>
                                <td class="style7">
                                    &nbsp;</td>
                                <td class="style13">
                                    &nbsp;</td>
                                <td class="style7">
                                    &nbsp;</td>
                                <td class="style29">
                                    &nbsp;</td>
                                <td class="style7">
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td class="style16">
                                    <strong>สถานที่ศึกษา :</strong></td>
                                <td>
                                    <asp:TextBox ID="TextBox6" runat="server" Width="120px" CssClass="style7"></asp:TextBox>
                                </td>
                                <td class="style31">
                                    <strong>วัน/เดือน/ปี เกิด :</strong></td>
                                <td style="font-size: small">
                                    <font size="2">
                                 <script type="text/javascript">
                                     Sys.Application.add_load(BindEvents); </script>
                                    </font>
                                    <asp:TextBox ID="TextBox8" runat="server" Width="120px"  onchange="calAge(this);"
                                        onkeypress="getDate(this)" CssClass="style7"></asp:TextBox>
                                </td>
                                <td class="style28">
                                    <strong>อายุ : </strong>
                                </td>
                                <td>
                                    <asp:TextBox ID="TextBox10" runat="server" Width="56px"    ></asp:TextBox>
                                    &nbsp;<strong><font size="2">ปี</font></strong></td>
                            </tr>
                            <tr>
                                <td class="style17">
                                    &nbsp;</td>
                                <td class="style7">
                                    &nbsp;</td>
                                <td class="style13">
                                    &nbsp;</td>
                                <td class="style7">
                                    &nbsp;</td>
                                <td class="style29">
                                    &nbsp;</td>
                                <td class="style7">
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td class="style16">
                                    <strong>E-mail :</strong></td>
                                <td>
                                    <asp:TextBox ID="TextBox7" runat="server" Width="120px" CssClass="style7"></asp:TextBox>
                                </td>
                                <td class="style31">
                                    <strong>วันที่สมัครเรียน :</strong></td>
                                <td>
                                 <script type="text/javascript">
                                     Sys.Application.add_load(BindEvents2); </script>
                                    <asp:TextBox ID="TextBox21" runat="server" onkeypress="getDate(this)" 
                                        Width="120px" CssClass="style7"></asp:TextBox>
                                    <span class="style51">*</span></td>
                                <td class="style28">
                                    <strong>วันที่เลิกเรียน : </strong></td>
                                <td>
                                    <font size="2">
                                <script type="text/javascript">
                                    Sys.Application.add_load(BindEvents3); </script>
                                    </font>
                                    <asp:TextBox ID="TextBox12" runat="server" onkeypress="getDate(this)" 
                                        Width="120px" CssClass="style7"></asp:TextBox>
                                    </td>
                            </tr>
                            <tr>
                                <td class="style18">
                                    &nbsp;</td>
                                <td class="style7">
                                    &nbsp;</td>
                                <td class="style35">
                                    &nbsp;</td>
                                <td class="style7">
                                    <asp:TextBox ID="TextBox42" runat="server" style="display:none" ></asp:TextBox>
                                </td>
                                <td class="style29">
                                    &nbsp;</td>
                                <td class="style7">
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td class="style16">
                                    <strong>รหัสครอบครัว&nbsp;:</strong></td>
                                <td class="style7">
                                    <asp:TextBox ID="TextBox40" runat="server" Width="121px"></asp:TextBox>
                                    <asp:TextBox ID="TextBox29" runat="server" Width="121px" CssClass="style7"  class="TextboxInput"  ></asp:TextBox>
                                    <span class="style51">   <asp:Button ID="Button6" runat="server" onclick="Button6_Click" Text="ค้นหา" style="display:none"    /></span></td>
                                <td class="style31">
                                    <strong>ชื่อครอบครัว :</strong></td>
                                <td class="style7">
                                    <asp:TextBox ID="TextBox33" runat="server" Width="121px" CssClass="style7"  
                                        class="TextboxInput"  ></asp:TextBox>
                                </td>
                                <td class="style29">
                                    &nbsp;</td>
                                <td class="style7">
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td class="style18">
                                    &nbsp;</td>
                                <td class="style7">
                                    <asp:TextBox ID="idfamily" runat="server" Visible="False" style="display:none"></asp:TextBox>
                                </td>
                                <td class="style35">
                                    &nbsp;</td>
                                <td class="style7">
                                    &nbsp;</td>
                                <td class="style29">
                                    &nbsp;</td>
                                <td class="style7">
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td class="style16">
                                    <strong>ชื่อ-นามสกุลผู้ปกครอง :</strong></td>
                                <td class="style7">
                                    <asp:TextBox ID="TextBox30" runat="server" Width="120px" CssClass="style7"  
                                        ></asp:TextBox>
                                </td>
                                <td class="style31">
                                    <strong>เบอร์โทรศัพท์ของผู้ปกครอง :</strong></td>
                                <td class="style7">
                                    <asp:TextBox ID="TextBox31" runat="server" Width="120px" CssClass="style7"  
                                         ></asp:TextBox>
                                </td>
                                <td class="style28">
                                    <strong>E-mailของผู้ปกครอง :</strong></td>
                                <td class="style7">
                                    <asp:TextBox ID="TextBox32" runat="server" Width="120px" CssClass="style7"  
                                        ></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="style16">
                                    &nbsp;</td>
                                <td>
                                 
                                    </td>
                                <td class="style31">
                                    &nbsp;</td>
                                <td class="style7">
                                    &nbsp;</td>
                                <td class="style30">
                                    &nbsp;</td>
                                <td class="style7">
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td class="style16">
                                    <b style="text-align: left">ชื่อ-นามสกุลบิดา :</b></td>
                                <td>
                                    <asp:TextBox ID="TextBox13" runat="server" Height="22px" Width="120px"  
                                      
                                        CssClass="style7"></asp:TextBox>
                                </td>
                                <td class="style31">
                                    <strong>เบอร์โทรศัพท์ของบิดา :</strong></td>
                                <td>
                                    <asp:TextBox ID="TextBox15" runat="server" Width="120px" CssClass="style7" 
                                        ></asp:TextBox>
                                </td>
                                <td class="style28">
                                    <strong>E-mailของบิดา :</strong></td>
                                <td>
                                    <asp:TextBox ID="TextBox19" runat="server" Width="120px" CssClass="style7" 
                                        ></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="style15">
                                    &nbsp;</td>
                                <td class="style7">
                                    &nbsp;</td>
                                <td class="style13">
                                    &nbsp;</td>
                                <td class="style7">
                                    &nbsp;</td>
                                <td class="style30">
                                    &nbsp;</td>
                                <td class="style7">
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td class="style16">
                                    <strong>ชื่อ-นามสกุลมารดา :</strong></td>
                                <td>
                                    <asp:TextBox ID="TextBox14" runat="server" Width="120px" CssClass="style7" 
                                        ></asp:TextBox>
                                </td>
                                <td class="style31">
                                    <strong>เบอร์โทรศัพท์ของมารดา :</strong></td>
                                <td>
                                    <asp:TextBox ID="TextBox16" runat="server" Width="120px" CssClass="style7" 
                                        ></asp:TextBox>
                                </td>
                                <td class="style28">
                                    <strong>E-mailของมารดา :</strong></td>
                                <td>
                                    <asp:TextBox ID="TextBox20" runat="server" Width="120px" CssClass="style7" Height="22px" 
                                         ></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="style15">
                                    &nbsp;</td>
                                <td class="style7">
                                    &nbsp;</td>
                                <td class="style35">
                                    &nbsp;</td>
                                <td class="style7">
                                    &nbsp;</td>
                                <td class="style30">
                                    &nbsp;</td>
                                <td class="style7">
                                    &nbsp;</td>
                            </tr>
                        </table>
                    </td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style3">
                        &nbsp;</td>
                    <td class="style4">
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style3">
                        &nbsp;</td>
                    <td class="style4">
                        <table cellpadding="0" cellspacing="0" class="style2">
                            <tr>
                                <td class="style38" style="font-weight: 700; text-align: right">
                                    หมายเหตุ:</td>
                                <td>
                                    <textarea ID="TextArea1" cols="20" name="S1" rows="2" runat="server"></textarea></td>
                            </tr>
                            <tr>
                                <td class="style37" style="font-weight: 700; text-align: left">
                                    &nbsp;</td>
                                <td>
                                    <asp:Label ID="st_codesend" runat="server" style="display:none"></asp:Label>
                                    &nbsp;<asp:Label ID="regissend" runat="server" style="display:none"></asp:Label>
                                    <asp:Label ID="facodesend" runat="server" style="display:none"></asp:Label>
                                    <asp:Label ID="fanamesend" runat="server" style="display:none"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td class="style68" style="font-weight: 700; ">
                                    <strong>วิธีจ่ายเงิน :</strong></td>
                                <td>
                                    <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" 
                                        onselectedindexchanged="DropDownList1_SelectedIndexChanged">
                                    </asp:DropDownList>
                                    &nbsp; &nbsp;&nbsp;&nbsp;<strong>ส่วนลด :</strong>&nbsp;
                                    <asp:Label ID="Label40" runat="server"></asp:Label>
                                    &nbsp;<strong>%</strong>
                                    <asp:TextBox ID="Label39" runat="server" style="display:none"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td class="style37" style="font-weight: 700; text-align: left">
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td class="style37" style="font-weight: 700; text-align: right">
                                    &nbsp;</td>
                                <td >
                                    <asp:Button ID="Button1" runat="server" Text="  บันทึก  " Width="60px" 
                                        onclick="Button1_Click"  OnClientClick="return chButton()"
                                        
                                        
                                        style="font-family: 'normal normal arial', helvetica, clean, sans-serif; font-size: small; font-weight: 700; color: #6666FF; height: 26px;" />
                                    &nbsp;&nbsp;
                                    <asp:Button ID="Button5" runat="server" onclick="Button1_Click" Text="แก้ไข" 
                                        
                                        style="font-family: 'normal normal arial', helvetica, clean, sans-serif; font-size: small; font-weight: 700; color: #6666FF;" 
                                        Width="60px" />
&nbsp;&nbsp; <asp:Button ID="Button2" runat="server" Text="  เคลียร์  " 
                                        Width="60px" onclick="Button2_Click" 
                                        
                                        style="font-family: 'normal normal arial', helvetica, clean, sans-serif; font-size: small; font-weight: 700; color: #6666FF;" 
                                        Height="26px" />
                                </td>
                            </tr>
                        </table>
                    </td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style3">
                        &nbsp;</td>
                    <td class="style4">
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style3">
                        &nbsp;</td>
                    <td class="style4">
                        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"  onrowdatabound="GridView1_RowDataBound" 
                            border="1" CellPadding="4" ForeColor="#333333" GridLines="None" DataKeyNames="st_id" 
                            Width="100%" style="font-size: small" 
                            onselectedindexchanged="GridView1_SelectedIndexChanged" 
                            onrowdeleting="GridView1_RowDeleting">
                            <AlternatingRowStyle BackColor="White" />
                            <Columns>
                              <asp:TemplateField ItemStyle-HorizontalAlign="Center">
                                              <HeaderTemplate>
                                                  ลำดับ
                                              </HeaderTemplate>
                                              <ItemTemplate>
                                                  <%#Container.DataItemIndex+1 %>
                                              </ItemTemplate>
                                              <ItemStyle HorizontalAlign="Center" />
                                          </asp:TemplateField>
                                           <asp:TemplateField HeaderText="id" Visible="False">
                                <ItemTemplate>
                                    <asp:HiddenField ID="HiddenField1" runat="server" Visible="false"
                                                      Value='<%# Eval("st_id") %>' /> 
                                </ItemTemplate>
                            </asp:TemplateField>
                              
                                 <asp:BoundField DataField="st_code" HeaderText="รหัสนักเรียน"  
                                    ItemStyle-HorizontalAlign="Center"  >
<ItemStyle HorizontalAlign="Center"></ItemStyle>
                                </asp:BoundField>
                               
                                 <asp:BoundField DataField="st_name" HeaderText="ชื่อ-นามสกุลนักเรียน"  
                                    ItemStyle-HorizontalAlign="left"  >
<ItemStyle HorizontalAlign="Left"></ItemStyle>
                                </asp:BoundField>
                                <asp:BoundField DataField="st_gender" HeaderText="เพศ"  
                                    ItemStyle-HorizontalAlign="center"  >
<ItemStyle HorizontalAlign="center"></ItemStyle>
                                </asp:BoundField>
                             <asp:BoundField DataField="family_Code" HeaderText="รหัสครอบครัว"  
                                    ItemStyle-HorizontalAlign="center"  >
<ItemStyle HorizontalAlign="center"></ItemStyle>
                                </asp:BoundField>
                              
                                   <asp:TemplateField HeaderText="ชื่อครอบครัว">
                                       <ItemTemplate>
                                           <asp:Label ID="Label19" runat="server" Text ='<%# Eval("family_name") %>'></asp:Label>
                                       </ItemTemplate>
                                         <HeaderStyle HorizontalAlign="left" />
                                                          <ItemStyle HorizontalAlign="left" />
                                </asp:TemplateField>
                                  <asp:TemplateField HeaderText="ชื่อบิดา">
                                      <ItemTemplate>
                                          <asp:Label ID="Label20" runat="server" Text ='<%# Eval("father_name") %>'></asp:Label>
                                      </ItemTemplate>
                                      <HeaderStyle HorizontalAlign="left" />
                                                          <ItemStyle HorizontalAlign="left" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="ชื่อมารดา">
                                    <ItemTemplate>
                                        <asp:Label ID="Label21" runat="server" Text ='<%# Eval("mother_name") %>'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle HorizontalAlign="left" />
                                                          <ItemStyle HorizontalAlign="left" />
                                </asp:TemplateField>
                             <asp:TemplateField HeaderText="วันเกิด">
                                      <ItemTemplate>
                                          <asp:Label ID="Label3" runat="server" Text='<%#  string.Format("{0:dd/MM/yyyy}",Eval("st_birthday")) %>'></asp:Label>
                                      </ItemTemplate>
                                      <HeaderStyle HorizontalAlign="center" />
                                                          <ItemStyle HorizontalAlign="center" />
                                </asp:TemplateField>
                                  <asp:TemplateField HeaderText="วันที่สมัครเรียน">
                                      <ItemTemplate>
                                          <asp:Label ID="Label1" runat="server" Text='<%#  string.Format("{0:dd/MM/yyyy}",Eval("register_date")) %>'></asp:Label>
                                      </ItemTemplate>
                                       <HeaderStyle HorizontalAlign="center" />
                                                          <ItemStyle HorizontalAlign="center" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="วันที่เลิกเรียน">
                                      <ItemTemplate>
                                          <asp:Label ID="Label2" runat="server" Text='<%#  string.Format("{0:dd/MM/yyyy}",Eval("st_end_date")) %>'></asp:Label>
                                      </ItemTemplate>
                                      <HeaderStyle HorizontalAlign="center" />
                                                          <ItemStyle HorizontalAlign="center" />
                                </asp:TemplateField>
                                 <asp:CommandField ButtonType="Image" HeaderText="แก้ไข" 
                                SelectImageUrl="~/Pages/images/icon_15.gif" SelectText="" 
                                ShowSelectButton="True" />
                                <asp:TemplateField HeaderText="ลบ" ItemStyle-HorizontalAlign="Center" 
                                              ShowHeader="False">
                                              <ItemTemplate>
                                                  <asp:ImageButton ID="ImageButton1" runat="server" CausesValidation="False" 
                                                      CommandName="Delete" ImageUrl="~/Pages/images/icon_del.gif" 
                                                      Text="Delete" />
                                              </ItemTemplate>
                                              <ItemStyle HorizontalAlign="Center" />
                                          </asp:TemplateField>
                                <asp:TemplateField HeaderText="รหัสครอบครัว" Visible="False">
                                    <ItemTemplate>
                                        <asp:HyperLink ID="HyperLink1" runat="server" Text ='<%# Eval("family_id") %>'></asp:HyperLink>
                                    </ItemTemplate>
                                </asp:TemplateField>
                               
                            </Columns>
                            <EditRowStyle BackColor="#2461BF" />
                            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                            <RowStyle BackColor="#EFF3FB" />
                            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                            <SortedAscendingCellStyle BackColor="#F5F7FB" />
                            <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                            <SortedDescendingCellStyle BackColor="#E9EBEF" />
                            <SortedDescendingHeaderStyle BackColor="#4870BE" />
                        </asp:GridView>
                    </td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style3">
                        &nbsp;</td>
                    <td class="style4">
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style3">
                        &nbsp;</td>
                    <td class="style27">
                        <strong>รายละเอียดวิชาที่ลงทะเบียน</strong></td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style3">
                        &nbsp;</td>
                    <td class="style4">
                        <asp:TextBox ID="TextBox38" runat="server" style="display:none"  ></asp:TextBox>
                    </td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style3">
                        &nbsp;</td>
                    <td class="style4">
                        <table cellpadding="0" cellspacing="0" class="style2">
                            <tr>
                                <td class="style40">
                                    <strong>รหัสวิชา :</strong></td>
                                <td class="style46">
                                    <asp:TextBox ID="TextBox22" runat="server" Width="107px"></asp:TextBox>
                                    &nbsp;&nbsp;<asp:TextBox ID="TextBox23" runat="server" ReadOnly="True" 
                                        style="background-color: #CCCCCC" Width="204px"></asp:TextBox>
                                    <span class="style51">*</span>&nbsp;
                                    <asp:Button ID="Button8" runat="server" onclick="Button8_Click" 
                                        style="display:none" Text="Button" />
                                </td>
                                <td class="style62">
                                    <asp:Label ID="lblID" runat="server" style="display:none"></asp:Label>
                                      <asp:TextBox ID="TextBox46" runat="server" style="display:none"></asp:TextBox>
                                    <asp:TextBox ID="TextBox45" runat="server" style="display:none"></asp:TextBox>
                                </td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td class="style39">
                                    &nbsp;</td>
                                <td class="style46">
                                  
                                    <asp:TextBox ID="st_detail_id" runat="server" style="display:none" ></asp:TextBox>
                                  
                                </td>
                                <td class="style64">
                                    &nbsp;</td>
                            </tr>
                        </table>
                    </td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style3">
                        &nbsp;</td>
                    <td class="style4">
                        <table cellpadding="0" cellspacing="0" class="style2">
                            <tr>
                                <td class="style42">
                                    &nbsp;</td>
                                <td class="style55">
                                    &nbsp;</td>
                                <td class="style59">
                                    &nbsp;</td>
                                <td class="style63">
                                    &nbsp;</td>
                                <td class="style49">
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                                <td class="style44">
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td class="style65" colspan="8">
                                    <asp:GridView ID="GridView3" runat="server"  border="1" 
                                        AutoGenerateColumns="False" CellPadding="4" ForeColor="#333333" 
                                        GridLines="None" Width="100%" 
                                       >
                                        <AlternatingRowStyle BackColor="White" />
                                    <Columns>
                                    <asp:TemplateField  ItemStyle-HorizontalAlign="Center" >
                                                                                        <HeaderTemplate>
                                                                                            ลำดับ
                                                                                        </HeaderTemplate>
                                                                                        <ItemTemplate>
                                                                                            <%#Container.DataItemIndex+1%>
                                                                                        </ItemTemplate>
                                                                                        <FooterStyle HorizontalAlign="Center" />
                                                                                        <HeaderStyle ForeColor="Black" HorizontalAlign="Center" />
                                                                                        <ItemStyle HorizontalAlign="Center" />
                                                                                    </asp:TemplateField>
                                                                                    <asp:TemplateField HeaderText="เลือก" ItemStyle-HorizontalAlign="Center">
                                                                                        <ItemTemplate>
                                                                                            <asp:RadioButton ID="rdobutton" runat="server" AutoPostBack="True" OnClick="javascript:CheckOnOff(this.id,'GridView3');"  oncheckedchanged="rdobutton_CheckedChanged" />
                                                                                        </ItemTemplate>
                                                                                        <FooterStyle HorizontalAlign="Center" />
                                                                                        <HeaderStyle ForeColor="Black" HorizontalAlign="Center" />
                                                                                        <ItemStyle HorizontalAlign="Center" />
                                                                                    </asp:TemplateField>
                                        <asp:TemplateField HeaderText="id" Visible="False">
                                            <ItemTemplate>
                                                <asp:Label ID="Label27" runat="server" Text='<%# Eval("emp_cls_mast_id") %>'></asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="ครูสอน">
                                            <ItemTemplate>
                                                <asp:Label ID="Label22" runat="server" Text='<%# Eval("emp_name") %>'></asp:Label>
                                            </ItemTemplate>
                                             <HeaderStyle HorizontalAlign="center" />
                                                <ItemStyle HorizontalAlign="left" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="วันเรียน">
                                            <ItemTemplate>
                                                <asp:Label ID="Label23" runat="server" Text='<%# Eval("emp_cls_day") %>'></asp:Label>
                                            </ItemTemplate>
                                             <HeaderStyle HorizontalAlign="center" />
                                                <ItemStyle HorizontalAlign="left" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="วันที่เริ่มสอน">
                                            <ItemTemplate>
                                                <asp:Label ID="Label38" runat="server" Text='<%#  string.Format("{0:dd/MM/yyyy}",Eval("start_date")) %>'></asp:Label>
                                            </ItemTemplate>
                                             <HeaderStyle HorizontalAlign="center" />
                                                <ItemStyle HorizontalAlign="center" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="เวลาเริ่มเรียน">
                                            <ItemTemplate>
                                                <asp:Label ID="Label24" runat="server" Text='<%# Eval("emp_cls_start") %>'></asp:Label>
                                            </ItemTemplate>
                                             <HeaderStyle HorizontalAlign="center" />
                                                <ItemStyle HorizontalAlign="center" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="เวลาสิ้นสุด">
                                            <ItemTemplate>
                                                <asp:Label ID="Label25" runat="server" Text='<%# Eval("emp_cls_end") %>'></asp:Label>
                                            </ItemTemplate>
                                             <HeaderStyle HorizontalAlign="center" />
                                                <ItemStyle HorizontalAlign="center" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="จำนวนชั่วโมง(ชม.)">
                                            <ItemTemplate>
                                                <asp:Label ID="Label26" runat="server" Text='<%# Eval("emp_cls_total_hours") %>'></asp:Label>
                                            </ItemTemplate>
                                             <HeaderStyle HorizontalAlign="center" />
                                                <ItemStyle HorizontalAlign="center" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="คอร์ส(คาบ)">
                                            <ItemTemplate>
                                                <asp:Label ID="Label28" runat="server" Text='<%# Eval("cls_course_time") %>'></asp:Label>
                                            </ItemTemplate>
                                             <HeaderStyle HorizontalAlign="center" />
                                                <ItemStyle HorizontalAlign="center" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="จำนวนเงิน(บาท)">
                                            <ItemTemplate>
                                                <asp:Label ID="Label29" runat="server" Text='<%# Eval("cls_course_amt") %>'></asp:Label>
                                            </ItemTemplate>
                                             <HeaderStyle HorizontalAlign="center" />
                                                <ItemStyle HorizontalAlign="right" />
                                        </asp:TemplateField>
                                      
                                    </Columns>
                                        <EditRowStyle BackColor="#2461BF" />
                                        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                                        <RowStyle BackColor="#EFF3FB" />
                                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                                        <SortedAscendingCellStyle BackColor="#F5F7FB" />
                                        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                                        <SortedDescendingCellStyle BackColor="#E9EBEF" />
                                        <SortedDescendingHeaderStyle BackColor="#4870BE" />
                                    </asp:GridView>
                                </td>
                            </tr>
                        </table>
                    </td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style3">
                        &nbsp;</td>
                    <td class="style4">
                        <table cellpadding="0" cellspacing="0" class="style2">
                            <tr>
                                <td class="style45">
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td class="style45">
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td class="style45">
                                    &nbsp;</td>
                                <td>
                                    <asp:Button ID="Button3" runat="server" onclick="Button3_Click"  OnClientClick="return selectbu()"
                                        style="font-family: 'normal normal arial', helvetica, clean, sans-serif; font-size: small; font-weight: 700; color: #6666FF;" 
                                        Text="  บันทึก  " Width="60px" />
                                    &nbsp;&nbsp;<asp:Button ID="Button4" runat="server" onclick="Button4_Click" 
                                        style="font-family: 'normal normal arial', helvetica, clean, sans-serif; font-size: small; font-weight: 700; color: #6666FF;" 
                                        Text="  เคลียร์  " Width="60px" />
                                </td>
                            </tr>
                            <tr>
                                <td class="style45">
                                    &nbsp;</td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                        </table>
                    </td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style3">
                        &nbsp;</td>
                    <td class="style4">
                        <asp:GridView ID="GridView4" runat="server" CellPadding="4" ForeColor="#333333" AutoGenerateColumns="False"
                            border="1"
                            GridLines="None" Width="100%" DataKeyNames="st_detail_id" 
                            onrowdatabound="GridView4_RowDataBound" onrowdeleting="GridView4_RowDeleting">
                            <AlternatingRowStyle BackColor="White" />
                            <Columns>
                                <asp:TemplateField>
                                    <HeaderTemplate>
                                        ลำดับ
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <%#Container.DataItemIndex+1 %>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="Center" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="นักเรียน" ItemStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                        <asp:Label ID="Label30" runat="server"    Text='<%# Eval("st_code")+" "+Eval("st_name") %>'></asp:Label>
                                    </ItemTemplate>
                                    <ItemStyle HorizontalAlign="Center" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="ครูสอน">
                                    <ItemTemplate>
                                        <asp:Label ID="Label31" runat="server" Text='<%# Eval("emp_code")+" "+Eval("emp_name") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="วิชา">
                                    <ItemTemplate>
                                        <asp:Label ID="Label32" runat="server" Text='<%# Eval(" cls_name") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="วันเรียน">
                                    <ItemTemplate>
                                        <asp:Label ID="Label33" runat="server" Text='<%# Eval(" emp_cls_day") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="เวลาเริ่มเรียน">
                                    <ItemTemplate>
                                        <asp:Label ID="Label34" runat="server" Text='<%# Eval(" emp_cls_start") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="คอร์ส(คาบ)">
                                    <ItemTemplate>
                                        <asp:Label ID="Label35" runat="server" Text='<%# Eval("cls_course_time") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="จำนวนเงิน(บาท)">
                                    <ItemTemplate>
                                        <asp:Label ID="Label36" runat="server" Text='<%# Eval("cls_course_amt") %>' ></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                 <asp:CommandField ButtonType="Image" HeaderText="ลบ" 
                                              ItemStyle-HorizontalAlign="Center" 
                                              SelectImageUrl="~/Pages/images/icon_del.gif"  
                                    ShowDeleteButton="True" DeleteImageUrl="~/Pages/images/icon_del.gif" 
                                    DeleteText="" >
                                              <ItemStyle HorizontalAlign="Center" />
                                          </asp:CommandField>
                                <asp:TemplateField HeaderText="st_detail_id" Visible="False">
                                    <ItemTemplate>
                                        <asp:Label ID="Label37" runat="server" Text='<%# Eval("st_detail_id") %>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <EditRowStyle BackColor="#2461BF" />
                            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                            <RowStyle BackColor="#EFF3FB" />
                            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                            <SortedAscendingCellStyle BackColor="#F5F7FB" />
                            <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                            <SortedDescendingCellStyle BackColor="#E9EBEF" />
                            <SortedDescendingHeaderStyle BackColor="#4870BE" />
                        </asp:GridView>
                    </td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style3">
                        &nbsp;</td>
                    <td class="style4">
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td class="style3">
                        &nbsp;</td>
                 
                    <td class="style4">
                        &nbsp;</td>
                    <td>
                        &nbsp;</td>
                </tr>
            </table>
</ContentTemplate>
    </asp:UpdatePanel>
    <p>
        <br />
    </p>
    <p>
        &nbsp;</p>
    <p>
    </p>
     <script type="text/javascript">
    function calculateHour() {
        var a = document.getElementById("ContentPlaceHolder1_TextBox25").value;
        var b = document.getElementById("ContentPlaceHolder1_TextBox26").value;
            
                
                var c = a.substring(0, 2);
                var d = a.substring(3, 5);
            
             
                var e = b.substring(0, 2);
                var f = b.substring(3, 5);
            
                var front = eval(parseInt(e) - parseInt(c));
                var back = eval(parseInt(f) -  parseInt(d));
                if (isNaN(front) || isNaN(back)) {
                    document.getElementById("ContentPlaceHolder1_TextBox39").value = '0.0';
                }
                else if (front < 0 || back < 0){

                    document.getElementById("ContentPlaceHolder1_TextBox39").value = '0.0';
                }else{
                    document.getElementById("ContentPlaceHolder1_TextBox39").value = front + '.' + back;
                
                }
            
            //alert(a.substring(0, 2));
            //alert(a.substring(3, 5));

            }
            </script>
  <script type="text/javascript">

      $(Sys.Application.add_load(function () {
          $("#ContentPlaceHolder1_TextBox29").focusout(function () {
              //alert("event focusout occurs.");

              document.getElementById('ContentPlaceHolder1_Button6').click();
          })
      }));
</script>
 <script type="text/javascript">

     $(Sys.Application.add_load(function () {
         $("#ContentPlaceHolder1_TextBox22").focusout(function () {
             //alert("event focusout occurs.");

             document.getElementById('ContentPlaceHolder1_Button8').click();
         })
     }));
</script>

<script type="text/javascript">

    $(Sys.Application.add_load(function () {
        $("#ContentPlaceHolder1_TextBox34").focusout(function () {
            //alert("event focusout occurs.");

            document.getElementById('ContentPlaceHolder1_Button10').click();
        })
    }));
</script>
    <script type="text/javascript">
        function openW(a) {


            var value1 = a
            emailwindow = dhtmlmodal.open('EmailBox', 'iframe', value1, '', 'width=750px,height=555px,center=1,resize=0,scrolling=1')

            emailwindow.onclose = function () {
                return true
            }


        }
        
</script>
</asp:Content>